package cn.dzhang.mybatis.repository.impl;

import java.util.List;

import cn.dzhang.mybatis.model.Article;
import cn.dzhang.mybatis.model.User;
import cn.dzhang.mybatis.repository.ArticleOperation;
import cn.dzhang.mybatis.repository.ArticleRepository;

import org.apache.ibatis.session.SqlSession;

public class ArticleRespositoryImpl implements ArticleRepository
{
	private SqlSession session;

	public ArticleRespositoryImpl()
	{
	}

	public ArticleRespositoryImpl(SqlSession session)
	{
		super();
		this.session = session;
	}

	public List<Article> findByUser(User user)
	{
		List<Article> articles = session.selectList(
		        ArticleOperation.findByUser, user);
		return articles;
	}

}
